/*
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2025-06-17 21:51:11
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-18 11:39:40
 * @FilePath: \vue3_admin_template\project\src\components\PublicMap\type\ttype.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// interface BaseMapLayer {
//     // 定义已知的底图类型
//     影像: {
//         map: {
//             source: { id: string; source: { type: string; tiles: string[]; tileSize: number; } };
//             layer: { id: string; type: string; source: string; minzoom: number; maxzoom: number; };
//         };
//         note: {
//             source: { id: string; source: { type: string; tiles: string[]; tileSize: number; } };
//             layer: { id: string; type: string; source: string; minzoom: number; maxzoom: number; };
//         };
//     };
//     经典: {
//         map: {
//             source: { id: string; source: { type: string; tiles: string[]; tileSize: number; } };
//             layer: { id: string; type: string; source: string; minzoom: number; maxzoom: number; };
//         };
//         note: {
//             source: { id: string; source: { type: string; tiles: string[]; tileSize: number; } };
//             layer: { id: string; type: string; source: string; minzoom: number; maxzoom: number; };
//         }
//     };
//     地形: {
//         map: {
//             source: { id: string; source: { type: string; tiles: string[]; tileSize: number; } };
//             layer: { id: string; type: string; source: string; minzoom: number; maxzoom: number; };
//         };
//         note: {
//             source: { id: string; source: { type: string; tiles: string[]; tileSize: number; } };
//             layer: { id: string; type: string; source: string; minzoom: number; maxzoom: number; };
//         };
//     };

//     // 添加索引签名以允许其他字符串键
//     [key: string]: {
//         map: {
//             source: { id: string; source: any };
//             layer: any;
//         };
//         note: {
//             source: { id: string; source: any };
//             layer: any;
//         };
//     };
// }
// 定义允许的底图类型
export type BaseMapType = '影像' | '经典' | '地形'

export interface FeatureCollection {
  type: 'FeatureCollection'
  features: Feature[]
}
type Geometry =
  | { type: 'Point'; coordinates: number[] }
  | { type: 'LineString'; coordinates: number[][] }
  | { type: 'Polygon'; coordinates: number[][][] }
  | { type: 'MultiPoint'; coordinates: number[][] }
  | { type: 'MultiLineString'; coordinates: number[][][] }
  | { type: 'MultiPolygon'; coordinates: number[][][][] }

export type Feature<G extends Geometry = Geometry, P = any> = {
  type: 'Feature'
  geometry: G
  properties: P | null
  id?: string | number
}

export interface mapListItem {
  id: string
  name: string
  layerId: string
  icon: string
}
export type mapList = mapListItem[]
